//注册默认用户
let mongoose = require('mongoose');
let JobModel = mongoose.models['Job'];


let register=async function(){
    for(let i=0;i<10;i++){
        let name='测试工作'+i;
        let user=await JobModel.findOne({name:name});
        if(!user){
            await JobModel.create({
                name:name,
                city:'湘潭',
                workType:['木工','泥工','钢筋工'],
                workCount:[10,30,10],
                company:'湘潭速派网络科技有限公司',
                addTime:new Date().getTime(),
                orderTime:new Date().getTime()
            });
        }
    }
    for(let i=10;i<20;i++){
        let name='测试工作'+i;
        let user=await JobModel.findOne({name:name});
        if(!user){
            await JobModel.create({
                name:name,
                city:'株洲',
                workType:['木工','水电工','杂工'],
                workCount:[10,5,50],
                company:'湘潭速派网络科技有限公司',
                addTime:new Date().getTime(),
                orderTime:new Date().getTime()
            });
        }
    }
}

register();
